function Lbt(el,options={}){
    this.el=document.querySelector(el)
    this.num=1
    this.t = null 
    this.init()
}
Lbt.prototype.init=function(){
    this.changeImg()
    this.tbyq()
    this.mouseoverout()
}
Lbt.prototype.changeImg=function(){
    this.t=setInterval(()=>{
        this.num++
        if(this.num>=7) this.num=1
        let imgObjs=this.el.querySelector('img')
        imgObjs.src=`./imges/img${this.num}.jpg`
        this.tbyq()
    },1000)
}
Lbt.prototype.tbyq=function(){
    let ulliObjs=this.el.querySelectorAll('ul li')
    ulliObjs.forEach(item=>{
        item.className=''
    })
    ulliObjs[this.num-1].className='active'     
}
//构造函数 原型函数 事件函数不写箭头、
//原型函数===构造函数===new出来的对象
Lbt.prototype.mouseoverout=function(){
    let ulliObjs=this.el.querySelectorAll('li')
    ulliObjs.forEach((item,index)=>{
        item.onmouseover=()=>{
            clearInterval(this.t)
            ulliObjs.forEach(item=>{
                item.className=''
            })
            ulliObjs[index].className='active'
            this.el.querySelector('img').src=`./imges/img${(index+1)}.jpg`
        }
        item.onmouseout=()=>{
            this.num=index+1
            this.changeImg()
        }
    })
}